class MainScene extends eui.Component implements  eui.UIComponent {

	public BtnUserInfo:WF.SingleButton;
	public BtnAddCoin:WF.SingleButton;
	public BtnSet:WF.SingleButton;

	public BtnRank:WF.SingleButton;
	public BtnBag:WF.SingleButton;
	public BtnMission:WF.SingleButton;
	public BtnShop:WF.SingleButton;
	
	public LabelNickName:eui.Label;
	public LabelCoin:eui.Label;
	
	public BtnRoom0:WF.SingleButton;
	public BtnRoom1:WF.SingleButton;
	public BtnRoom2:WF.SingleButton;
	public BtnRoom3:WF.SingleButton;
	public BtnQuickStart:WF.SingleButton;
	
	public BtnPackZX:WF.SingleButton;
	public BtnPackGXFC:WF.SingleButton;

	public constructor() {
		super();
	}

	protected partAdded(partName:string,instance:any):void
	{
		super.partAdded(partName,instance);
	}

	protected childrenCreated():void
	{
		super.childrenCreated();

		// this.LabelNickName
		
		this.BtnUserInfo.addEventListener(egret.TouchEvent.TOUCH_END, this.onUserInfo, this);
		this.BtnAddCoin.addEventListener(egret.TouchEvent.TOUCH_END, this.onAddCoin, this);
		this.BtnSet.addEventListener(egret.TouchEvent.TOUCH_END, this.onSet, this);

		this.BtnRank.addEventListener(egret.TouchEvent.TOUCH_END, this.onShowLayer, this);
		this.BtnBag.addEventListener(egret.TouchEvent.TOUCH_END, this.onShowLayer, this);
		this.BtnMission.addEventListener(egret.TouchEvent.TOUCH_END, this.onShowLayer, this);
		this.BtnShop.addEventListener(egret.TouchEvent.TOUCH_END, this.onShowLayer, this);
		
		this.BtnRoom0.addEventListener(egret.TouchEvent.TOUCH_END, this.onRoom, this);
		this.BtnRoom1.addEventListener(egret.TouchEvent.TOUCH_END, this.onRoom, this);
		this.BtnRoom2.addEventListener(egret.TouchEvent.TOUCH_END, this.onRoom, this);
		this.BtnRoom3.addEventListener(egret.TouchEvent.TOUCH_END, this.onRoom, this);
		this.BtnQuickStart.addEventListener(egret.TouchEvent.TOUCH_END, this.onQuickStart, this);

		this.BtnPackZX.addEventListener(egret.TouchEvent.TOUCH_END, this.onShowPack, this);
		this.BtnPackGXFC.addEventListener(egret.TouchEvent.TOUCH_END, this.onShowPack, this);
	}

	private onUserInfo(_event:egret.TouchEvent):void
	{
		console.log("onUserInfo");
	}

	private onAddCoin(_event:egret.TouchEvent):void
	{
		console.log("onAddCoin");
	}

	private onSet(_event:egret.TouchEvent):void
	{
		console.log("onSet");
	}

	private onShowLayer(_event:egret.TouchEvent):void
	{
		switch(_event.target)
		{
		case this.BtnRank:
			console.log("onShowRank");
			break;
		case this.BtnBag:
			console.log("onShowBag");
			break;
		case this.BtnMission:
			console.log("onShowMission");
			break;
		case this.BtnShop:
			console.log("onShowShop");
			break;
		}
	}

	private onRoom(_event:egret.TouchEvent):void
	{
		switch(_event.target)
		{
		case this.BtnRoom0:
			console.log("BtnRoom0");
			break;
		case this.BtnRoom1:
			console.log("BtnRoom1");
			break;
		case this.BtnRoom2:
			console.log("BtnRoom2");
			break;
		case this.BtnRoom3:
			console.log("BtnRoom3");
			break;
		}
	}

	private onQuickStart(_event:egret.TouchEvent):void
	{
		console.log("onQuickStart");
	}

	private onShowPack(_event:egret.TouchEvent):void
	{
		switch(_event.target)
		{
		case this.BtnPackZX:
			console.log("onPackZX");
			break;
		case this.BtnPackGXFC:
			console.log("onPackGXFC");
			break;
		}
	}
}